//初始化数据
function tabbarinit() {
  return [
    {
      "current": 0,
      'flag': false,
      "pagePath": "../../pages/totalMsg/totalMsg",
      "text": "总览",
      "iconPath": "../../image/newImg/overview0.png",
      "selectedIconPath": "../../image/newImg/overview1.png"
    },
    {
      "current": 0,
      'flag': false,
      "pagePath": "../../pages/machine-maintain/machine-maintain",
      "text": "整机维保",
      "iconPath": "../../image/newImg/Maintain0.png",
      "selectedIconPath": "../../image/newImg/Maintain1.png"
    }
  ]

}
//tabbar 主入口
function tabbarmain(bindName = "tabdata", id, target) {
  var that = target;
  var bindData = {};
  var otabbar = tabbarinit();
  otabbar[id]['iconPath'] = otabbar[id]['selectedIconPath']//换当前的icon
  otabbar[id]['current'] = 1;
  otabbar[id]['flag'] = true;
  bindData[bindName] = otabbar
  that.setData({ bindData });
}

module.exports = {
  tabbar: tabbarmain
}
